<?php
$cs = Yii::app()->getClientScript();
$baseUrl = Yii::app()->request->baseUrl;
$cs->registerCssFile($baseUrl . '/css/post-list.css');
?>
<ul class="posts-list">
    <?php foreach($posts as $post): ?>
    <li class="item">
        <div class="image">
            <div>
                <?php Util::thumbnailImage($post['image'], array(120, 90)) ?>
            </div>
        </div>
        <div class="info">
            <a class="header" href="<?php echo $this->createUrl('post/view', array('id' => $post['id'])) ?>">
            <?php echo $post['title'] ?>
            </a>
            <div class="content">
            <?php echo $post['content'] ?>
            <?php if ($post['hasMore']): ?>
                &nbsp;...&nbsp;
                <a class="header" href="<?php echo $this->createUrl('post/view', array('id' => $post['id'])) ?>">
                <?php echo Yii::t('default', 'read more')?>
                </a>
            <?php endif ?>
            </div>
        </div>
    </li>
    <?php endforeach ?>
</ul>
<div class="pagging">
    <div>
        <?php $this->widget('CLinkPager', array(
            'pages' => $pages,
        )) ?>
    </div>
</div>
